Copyright: MBD Help   (c)1995 by M.J. Warwick


Contents
Message Box Designer

Copyright ©1995 by  Mel Warwick

Click on the topic you require information on.

Overview

User Interface

Visual Basic MsgBox Constants

Distribution Rights

Disclaimer

Software Support


Overview

MESSAGE BOX DESIGNER is designed to simplify the creation of message boxes in VB (Visual Basic) code.

The VB MsgBox function/statement requires the combination of several constants to describe the style of the message box desired. MESSAGE BOX DESIGNER allows you to interactively design your message boxes, preview them to ensure they look as you intended and then paste the VB source code required to create them directly into a VB code window.


User Interface

Move the mouse pointer over the area of interest and click to reveal specific information.


VB MsgBox Constants
Visual Basic MsgBox Constants

The following constants are defined for use with the Visual Basic MsgBox function/statement. Though not required by MESSAGE BOX DESIGNER they are included here for you to paste into your application should you have need of them.

' Number and type of buttons to display

Global Const MB_OK = 0	' OK button only
Global Const MB_OKCANCEL = 1	' OK and Cancel buttons
Global Const MB_ABORTRETRYIGNORE = 2	' Abort, Retry, and Ignore buttons
Global Const MB_YESNOCANCEL = 3	' Yes, No, and Cancel buttons
Global Const MB_YESNO = 4	' Yes and No buttons
Global Const MB_RETRYCANCEL = 5	' Retry and Cancel buttons

' Icon style

Global Const MB_ICONSTOP = 16	' Critical message
Global Const MB_ICONQUESTION = 32	' Warning query
Global Const MB_ICONEXCLAMATION = 48	' Warning message
Global Const MB_ICONINFORMATION = 64	' Information message

' Modality

Global Const MB_SYSTEMMODAL = 4096	' System Modal
Global Const MB_APPLMODAL = 0	' Application Modal Message Box

' Default button

Global Const MB_DEFBUTTON1 = 0	' First button is default
Global Const MB_DEFBUTTON2 = 256	' Second button is default
Global Const MB_DEFBUTTON3 = 512	' Third button is default

' MsgBox function return values

Global Const IDOK = 1	' OK button pressed
Global Const IDCANCEL = 2	' Cancel button pressed
Global Const IDABORT = 3	' Abort button pressed
Global Const IDRETRY = 4	' Retry button pressed
Global Const IDIGNORE = 5	' Ignore button pressed
Global Const IDYES = 6	' Yes button pressed
Global Const IDNO = 7	' No button pressed


Distribution

The program MESSAGE BOX DESIGNER, and its Visual Basic source code, are released by the author as FREEWARE. Copyright is retained.

You are at liberty to distribute copies of the program as long as no monetary charge is made and the program, source code and documentation are not altered in any way. Within the privacy of your own home you can do what you like to the program... bang a nail into it... slap it between two slices of bread and call it a sarnie.... Any such modified copies must be for your personal use and must not be distributed.


Disclaimer

You own and run copies of MESSAGE BOX DESIGNER entirely at your own risk. MESSAGE BOX DESIGNER is distributed 'as is' without warranty of any kind. It is up to you to determine whether to let it anywhere near your beloved machine.

IN NO EVENT WILL THE AUTHOR BE LIABLE OR RESPONSIBLE FOR ANY LOSS, DAMAGE OR ANY OTHER PROBLEM CAUSED BY THE USE OF MESSAGE BOX DESIGNER. THE TOTAL RISK OF USING MESSAGE BOX DESIGNER RESTS WITH THE USER.


Software Support

If you have any problems with MESSAGE BOX DESIGNER or have any suggestions for its enhancement you may contact the author

Mel Warwick

via FidoNet at

2:252/21.93

or by mail at

70 Derwent Road

GRANTHAM

Lincs. NG31 7PD


FidoNet is an international amateur electronic mail network.


This area displays the title of the application.


Click this button to access the program's Control menu.

This menu contains commands used to control the program window.


Enter here the text of the title you wish displayed at the top of the message box. If no text is entered {application name} will be displayed on previewing the message box and the created message box will display the name of the application that created it.


Enter here the text of the message you wish displayed in the message box.


Select from this drop down list the number and type of buttons to be displayed on the message box.


Select from this drop down list the button that is to be the default button of the message box. That is, the button that will respond to the Enter key being depressed if no other button is selected.


This area displays the selected icon that will be displayed on the created message box.


Use this scrollbar to select the icon to be used on the created message box. The selected icon will be displayed adjacent to the scrollbar.


Selecting this option button sets the modality of the created message box to system modal. That is, all applications are suspended until the user responds to the message box.

Note:  Creating a message box with a combination of system modality and a Stop icon produces a message box that differs in format to normal message boxes. When Windows creates and displays such a message box no other processes are carried out during its creation. Such message boxes are limited to displaying only three lines of text and are intended for use in critical error situations.


Selecting this option button sets the modality of the created message box to application modal. That is, the current application (the one that generated the message box) is suspended until the user responds to the message box. All other applications continue to be processed.


Click on this button to clear the Title and Message text boxes of their contents.


Click on this button to export (copy) the VB source code required to create the designed message box to the clipboard. If a VB code window is open the source code will be pasted directly into that code window at the current cursor position of that window.

The source code may be exported as a VB MsgBox function or statement. See VB documentation for further details.

Two variables are used by the exported code:

Variable Name	Type	Purpose
MBD_MsgText	String	Holds the text that forms the message to be displayed in the message box.
MBD_BtnReturned	Integer	Holds the value returned by a MsgBox function call.
You can change these in your code if you wish though they are sufficiently unique for you to leave as is.


Click on this button to display an example of the message box that would be created using the type values selected.


Click on this button to terminate the program.


Click on this button to load this help text.


Click on this button to reduce the program window to an icon.


Displays the number of text lines contained in the message. Note that long lines may be split when displayed in the message box.


Two variables are used by the exported code:

Variable Name	Type	Purpose
MBD_MsgText	String	Holds the text that forms the message to be displayed in the message box.
MBD_BtnReturned	Integer	Holds the value returned by a MsgBox function call.
You can change these in your code if you wish though they are sufficiently unique for you to leave as is.